export default{
	common:{
		baseUrl:"http://localhost:8080",	
		data:{},
		header:{
			"Content-Type":"application/json;charset=UTF-8",
			"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"
		},
		method:"GET",
		dataType:"json"
},
	request(options={}){
		options.url = this.common.baseUrl + options.url;
		options.data = options.data || this.common.data;
		options.header = options.header || this.common.header;
		options.method = options.method || this.common.method;
		options.dataType = options.dataType || this.common.dataType;
		return new Promise((res,rej)=>{
			uni.request({
				...options,
				success:(result) => {
					// if(result.statusCode != 200){
					// 	return rej();
					// }	
					// let data = result.data.data;
					let data = result.data;
					console.log("request.js的数据")
					console.log(data)
					res(data)
				}
			})
			
		})
	}
}